package com.xm.quartz;

import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;

import java.util.Date;

/**
 * Job接口实现类
 *   <groupId>org.quartz-scheduler</groupId>
 *   <artifactId>quartz</artifactId>
 *   <version>2.5.0</version>
 */
public class MyJob implements Job {
    @Override
    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
        try {
            System.out.println("定时任务执行: " + new Date());
        } catch (Exception e) {
            // 日志记录
            // 重试机制
            throw new RuntimeException(e);
        } finally {
        }
    }
}
